package com.example.farmeri.presenter.mine;

import com.example.farmeri.presenter.base.BasePresenter;
import com.example.farmeri.tools.ResponseUtils;

import java.util.Map;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.annotations.NonNull;

public class AlertPwdPresenter extends BasePresenter<IAlertPwdContract> {
    protected final String TAG = this.getClass().getSimpleName();

    public AlertPwdPresenter(IAlertPwdContract view) {
        super(view);
    }


    public void alertPwd(Map<String, String> map) {
        getAPI().alertPwd(createFormBody(map))
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new SimpleObservable<ResponseUtils>() {
                    @Override
                    public void onSuccess(@NonNull ResponseUtils responseUtils) {
                        getView().onAlertPwdSuccess();
                    }

                    @Override
                    public void onError(String msg) {
                        getView().onAlertPwdError(msg);
                    }
                });
    }


}
